/*
 * GLOBEXApp.java
 */

package vista;

import java.rmi.RemoteException;

import modelo.maestro.Maestro;

import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;

import bbdd.configuracion.Configuracion;
import bbdd.informes.Informes;

/**
 * The main class of the application.
 */
public class GLOBEXApp extends SingleFrameApplication {

    /**
     * At startup create and show the main frame of the application.
     */
    @Override protected void startup() {
    	Configuracion c = new Configuracion();
    	Informes informes = new Informes();
    	
    	GLOBEXView vista =new GLOBEXView(this);
    	vista.actualizarSCADAParametrosConfiguracion();
        show(vista);
    	//show(new GLOBEXView(this));
        
    	Maestro _maestro;
		try {
			_maestro = new Maestro(vista);
	    	//_maestro.run();
	    	new Thread(_maestro).start();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }

    /**
     * This method is to initialize the specified window by injecting resources.
     * Windows shown in our application come fully initialized from the GUI
     * builder, so this additional configuration is not needed.
     */
    @Override protected void configureWindow(java.awt.Window root) {
    }

    /**
     * A convenient static getter for the application instance.
     * @return the instance of GLOBEXApp
     */
    public static GLOBEXApp getApplication() {
        return Application.getInstance(GLOBEXApp.class);
    }

    /**
     * Main method launching the application.
     */
    public static void main(String[] args) {
        launch(GLOBEXApp.class, args);
    }
}
